package com.huawei;

import java.util.Scanner;

/**
 * Created by Z-hong on 2024/7/2.
 */

public class HJ14 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int count = sc.nextInt();
        String strs[]=new String[count];

        for(int j=0;j<count;j++){
            strs[j]=sc.next();
        }
        quickSort(strs,0,count-1);
        for (String str : strs) {
            System.out.println(str);
        }
    }

    //快速排序
    public static void quickSort(String [] strs,int left,int right){
        if(right>left){
            int r=right;
            int l=left;
            String pivot=strs[left];
            while(r>l){
                while(r>l&&strs[r].compareTo(pivot)>0){
                    r--;
                }
                if(r>l){
                    strs[l]=strs[r];
                    l++;
                }

                while(r>l&&strs[l].compareTo(pivot)<0){
                    l++;
                }
                if(r>l){
                    strs[r]=strs[l];
                    r--;
                }
            }
            strs[l]=pivot;
            quickSort(strs, left, l-1);
            quickSort(strs, l+1, right);
        }
    }
}
